﻿using System;
using System.Collections.Generic;
using System.Linq;
using DevManager.Services;

namespace DevManager.Models;

public class LanguageModel
{
    public LanguageList Info { get; set; }

    public LanguageModel(LanguageList list)
    {
        Info = list;
        Installed = list.HasStrings.Select(x => LanguageService.IsInstalled(x.Key, x.Value)).ToList();
    }

    public LanguageModel()
    {
        Info = new LanguageList();
    }

    public List<InstalledModel> Installed { get; } = new();
    //public List<Package> PackageList { get; } = new();
}

public class InstalledModel
{
    public string Name { get; set; } = "";
    public bool IsInstalled { get; set; }
    public string[] Versions { get; set; } = Array.Empty<string>();
}